<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK"%>
<script language="javascript">

function ChangeSelect(ParentValue, NextId, NextSelectedValue, ArrObj,DefaultStr)
{
StrObj = eval(document.getElementById(NextId));
StrObj.length = 0;

//显示所有列表
for (i = 0; i < ArrObj.length; i++)
{
if (i == 0)
{
if (DefaultStr == undefined ) DefaultStr="==请选择==";
StrObj.options[StrObj.length] = new Option(DefaultStr, "");
}
if (ArrObj[i][1] == ParentValue)
{
StrObj.options[StrObj.length] = new Option(ArrObj[i][0],ArrObj[i][2]);
}
}
//选中列表内某一项
for (i = 0; i < StrObj.length; i++)
{
if (StrObj.options[i].value == NextSelectedValue)
{
StrObj.options[i].selected = true;
}
}
//激发下一级的onchange事件以实现多级级联
StrObj.onchange();
}

org = [
["名称","上级id","自己id"],
//第一级
<logic:present name="blist">
<logic:iterate id="item" name="blist">
["${item.bclassName}/${item.bclassNameEn}","0","${item.bclassId}"],
</logic:iterate>
</logic:present>
//第二级
<logic:present name="slist">
<logic:iterate id="item" name="slist">
["${item.sclassName}/${item.sclassNameEn}","${item.bclassId}","${item.sclassId}"],
</logic:iterate>
</logic:present>

["theEnd","theEnd","theEnd"]
];

</script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #F8F9FA;
}
-->
</style>

<link href="part2admin/images/skin.css" rel="stylesheet" type="text/css" />
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="17" height="29" valign="top"
			background="images/mail_leftbg.gif"><img
			src="part2admin/images/left-top-right.gif" width="17" height="29" /></td>
		<td width="935" height="29" valign="top"
			background="part2admin/images/content-bg.gif">
		<table width="100%" height="31" border="0" cellpadding="0"
			cellspacing="0" class="left_topbg" id="table2">
			<tr>
				<td height="31">
				<div class="titlebt">添加产品</div>
				</td>
				<td align="right"><a href="javascript:;"
					onClick="$.closePopupLayer('addPro')" title="Close"
					class="close-link"><img
					src="part2admin/common/js/box/close.png" border="0" /></a></td>
			</tr>
		</table>
		</td>
		<td width="16" valign="top"
			background="part2admin/images/mail_rightbg.gif"><img
			src="part2admin/images/nav-right-bg.gif" width="16" height="29" /></td>
	</tr>
	<tr>
		<td height="71" valign="middle"
			background="part2admin/images/mail_leftbg.gif">&nbsp;</td>
		<td valign="top" bgcolor="#F7F8F9">
		<form name="productForm" id="add" method="post"
			action="productAction.do?method=add" onSubmit="return check()">
		<table width="100%" height="138" border="0" cellpadding="0"
			cellspacing="0">
			<tr>
				<td height="13" valign="top">&nbsp;</td>
			</tr>
			<tr>
				<td valign="top">
				<table width="98%" border="0" align="center" cellpadding="0"
					cellspacing="0">
					<tr>
						<td class="left_txt">当前位置：添加产品 &nbsp;&nbsp;&nbsp;&nbsp; <font
							style="color: red">(*为必填项)</font></td>
					</tr>
					<tr>
						<td height="20">
						<table width="100%" height="1" border="0" cellpadding="0"
							cellspacing="0" bgcolor="#CCCCCC">
							<tr>
								<td></td>
							</tr>
						</table>
						</td>
					</tr>
					<tr>
						<td></td>
					</tr>
					<tr>
						<td></td>
					</tr>

					<tr>

						<td>

						<table width="100%" border="0" cellspacing="0" cellpadding="0">


							<tr>
								<td height="30" colspan="4" align="right" class="left_txt2">
								<table width="100%" height="31" border="0" cellpadding="0"
									cellspacing="0" class="nowtable">
									<tr>
										<td class="left_bt2">&nbsp;&nbsp;&nbsp;产品内容</td>
									</tr>
								</table>
								</td>
							</tr>
							<tr>


								<td height="30" colspan="3" class="left_txt">产品名称：<font
									style="color: red">*</font></td>
								<td width="89%" height="30" class="left_txt"><input
									id="title" type="text" name="voa.value(pro).field(title)"
									size="30" /></td>
							</tr>
							<tr>
								<td height="30" colspan="3" class="left_txt">Name：</td>
								<td height="30" class="left_txt"><input id="titleEn"
									type="text" name="voa.value(pro).field(titleEn)" size="30" /></td>
							</tr>
							<tr>
								<td height="30" colspan="3" class="left_txt">产品图片：</td>
								<td height="30" class="left_txt"><input type="text"
									id="pic" name="voa.value(pro).field(pic)" readOnly="true"
									size="30"> <input type="button"
									onClick="
				  javascript:open('uploadAction.do?method=preUpload&fileType=pic','','resizable=0,scrollbars=0,status=no,toolbar=no,menu=no,width=400,height=150,left=400,top=300')
				  "
									value="上传" id="uploadbutton"></td>
							</tr>
							<tr>
								<td height="30" colspan="3" class="left_txt">产品分类：</td>
								<td height="30" class="left_txt"><select id="big"
									name="voa.value(pro).field(big)"
									onChange="ChangeSelect(this.value,'small','',org,'请选择小类')"></select>
								<select id="small" name="voa.value(pro).field(small)"
									onChange=""></select> <script language="JavaScript"
									type="text/javascript">ChangeSelect('0','big','',org,'请选择大类') </script>
								</td>
							</tr>
							<tr>
								<td height="30" colspan="3" class="left_txt">产品型号：</td>
								<td height="30" class="left_txt"><input id="type"
									type="text" name="voa.value(pro).field(type)" size="30" /></td>
							</tr>
							<tr>
								<td height="30" colspan="3" class="left_txt" valign="top">简&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;介：</td>
								<td height="30" class="left_txt"><FCK:editor
									id="voa.value(pro).field(info)"
									basePath="part2admin/common/FCKeditor/" toolbarSet="part2"
									height="300">
								</FCK:editor></td>
							</tr>
							<tr>
								<td height="30" colspan="3" class="left_txt" valign="top">
								Introduction：</td>
								<td height="30" class="left_txt"><FCK:editor
									id="voa.value(pro).field(infoEn)"
									basePath="part2admin/common/FCKeditor/" toolbarSet="part2"
									height="300">
								</FCK:editor></td>
							</tr>
							<tr>
								<td height="30" colspan="3" class="left_txt" valign="top">详细介绍：</td>
								<td height="30" class="left_txt"><FCK:editor
									id="voa.value(pro).field(content)"
									basePath="part2admin/common/FCKeditor/" toolbarSet="part2"
									height="300">
								</FCK:editor></td>
							</tr>
							<tr>
								<td height="30" colspan="3" class="left_txt">Content：</td>
								<td height="30" class="left_txt"><FCK:editor
									id="voa.value(pro).field(contentEn)"
									basePath="part2admin/common/FCKeditor/" toolbarSet="part2"
									height="300">
								</FCK:editor></td>
							</tr>
							<tr>
								<td height="30" colspan="3" class="left_txt">附&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件：</td>
								<td height="30" class="left_txt"><input type="text"
									id="att" name="voa.value(pro).field(att)" readonly="true"
									size="30"> <input type="button"
									onClick=" 
javascript:open('uploadAction.do?method=preUpload&fileType=att','','resizable=0,scrollbars=0,status=no,toolbar=no,menu=no,width=400,height=150,left=400,top=300')
				  "
									value="上传" id="uploadbutton"> <a href="#"
									onClick="javascript:document.getElementById('att').value='';">清除附件</a></td>
							</tr>
						</table>
						</td>
					</tr>
				</table>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td width="50%" height="30" align="right"><input
							type="submit" value="确定" name="B1" /></td>
						<td width="6%" height="30" align="right">&nbsp;</td>
						<td width="44%" height="30"><input type="reset" value="取消"
							name="B12" /></td>
					</tr>
				</table>
				</td>
			</tr>

		</table>
		</form>
		</td>
		<td background="part2admin/images/mail_rightbg.gif">&nbsp;</td>
	</tr>
	<tr>
		<td valign="middle" background="part2admin/images/mail_leftbg.gif"><img
			src="part2admin/images/buttom_left2.gif" width="17" height="17" /></td>
		<td height="17" valign="top"
			background="part2admin/images/buttom_bgs.gif"><img
			src="part2admin/images/buttom_bgs.gif" width="17" height="17" /></td>
		<td background="part2admin/images/mail_rightbg.gif"><img
			src="part2admin/images/buttom_right2.gif" width="16" height="17" /></td>
	</tr>
</table>

<script language="javascript">
function check(){
	if  (document.productForm.title.value.length  ==  0)  {  
		alert("请输入标题!");
		document.productForm.title.focus();
		return  false;
	}	
	return true;
}

</script>
</body>
